# !/usr/usuari/des python
#  -*- coding: utf-8 -*-
"""
@Author        : itgnay
@Time          : 2022/12/18 20:38
@FileName      : 汉诺塔问题.py
@LastEditors   : None
@Editors       : PyCharm
"""
"""递归思想"""


def hanoi(num, sou, tar, aux):
    if num == 1:
        print('从 %c 移动至 %c' % (sou, tar))
    else:
        hanoi(num - 1, sou, aux, tar)
        hanoi(1, sou, tar, aux)
        hanoi(num - 1, aux, tar, sou)


hanoi(3, 'A', 'B', 'C')
